package com.ruoyi.project.test.gds;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.IOException;

public class My_DICOM {

    static FileInputStream input;

    static byte[] b;

    public static void main(String[] args) {

        try {

            File file = new File("C:\\Users\\admin\\Desktop\\gds相关资料\\probe.gds");

            input = new FileInputStream(file);

            b = new byte[(int) file.length()];

            input.read(b);

        } catch (FileNotFoundException e) {

            e.printStackTrace();

        } catch (IOException e) {

            e.printStackTrace();

        }

        init();

    }

    public static void init(){

        System.out.println("b.length="+b.length);

        for (int i =0;i<b.length;i++) {

            if (b[i]<0) {

                int temp=b[i]+256;

                System.out.print(Integer.toHexString(temp));

            }else{

                System.out.print(Integer.toHexString(b[i]));

            }

            if (i%16==15) {

                System.out.println();

            }else{

                System.out.print(", ");

            }

        }

    }

}
